﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaffContractorStaffEntry.aspx.cs" Inherits="MTRC.ODMS.Web.SOM.CodeSetup.StaffContractorStaffEntry" %>
<%@ Register Assembly="APJ.Web.UI.WebControls" Namespace="APJ.Web.UI.WebControls"
    TagPrefix="APJ" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %>
<%@ Register Src="~/UserControl/Menu/PageFoot.ascx" TagName="PageFoot" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/TabStrip.ascx" TagName="TabStrip" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/PageHead.ascx" TagName="PageHead" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="WebStructure" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Operational Data Management System</title>
    <link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" />
    <script  type="text/jscript" language="JavaScript" src="../../Javascript/CommonFunction.js"></script> 
    
    <script language="javascript" type="text/javascript">
    var ReadOnly='<%=ViewState["ReadOnly"]%>' 
    var msgDepartureMustSave= '<%=this.GetMessage("SOM_DepartureMustSave")%>'
    var UserValidatePath='<%=this.GetMessage("SOM_DepartureMustSave")%>'
    var TNProtected='<%=this.GetMessage("SOM_TNProtected")%>'
    var LeavePage='<%=this.GetMessage("COM_LeavePage")%>'
    var msgTransferSuccess='<%=this.GetMessage("SOM_TranserSuccess")%>'

    function SaveValidate(msgContractorCompany,msgContractorName) {
        var contractorCompany = document.getElementById("ddlContractorCompany").value;
        alert(contractorCompany);
        if (contractorCompany == '' || contractorCompany == null) {
            alert(msgContractorCompany);
            document.getElementById("ddlContractorCompany").focus();
            return false;
        }
        var LocalContractorDesc1 = document.getElementById("txtLocalContractorDesc1").value;
        if (LocalContractorDesc1 == '' || LocalContractorDesc1 == null) {
            alert(msgContractorName);
            document.getElementById("txtLocalContractorDesc1").focus();
            return false;
        }
    }

    function Save2(bIsUserValidateNeeded, UserId, Domain) {
        if (bIsUserValidateNeeded == 'true') {
            showModalDialog(ENV_SSLApplicationPath + "/LPM/Common/validation.aspx?FunID=M140845&IsDefaultUser=true" + "&UserId=" + UserId + "&Domain=" + Domain, window, 'status:no;resizable:no;dialogHeight:192px;dialogWidth:435px;scroll:no;');
            document.getElementById('hdnFlagNeedValit').value = "4"; //to validated user and save data
            //return true;

        }
        else {
            document.getElementById('hdnFlagNeedValit').value = "5"; //do noting
            //return true;
        }
    }
        //----------------------Fire System End ----------------------   
        
  function KeyDown(obj) 
    {         
       if(window.event.keyCode==17 || window.event.keyCode==16)//17-Ctrl,16-shift
       {
            return false;		
       }       
       if((window.event.keyCode==8) || (window.event.keyCode==9) || (window.event.keyCode==46) || (window.event.keyCode==37) || (window.event.keyCode==38) || (window.event.keyCode==39) || (window.event.keyCode==40))
       {
          return true;
       }      
       if((window.event.keyCode>=48 && window.event.keyCode<=57) || (window.event.keyCode>=96 && window.event.keyCode<=105))        
       {              
          return true;
       }
       else
       {	
          event.keyCode=0;
          return false;
       }	
    }       
    
    function IsInteger(val)
    {
        var re;
        re = /^[0-9]*[1-9][0-9]*$/;
        return re.exec(val);	        
    }
 
    function CheckTelNo(obj)
    {         
      if (obj.value!="")
      {
            if (!IsInteger(obj.value))
            {         
              obj.value=obj.title;       
              return false;
            }      
            else
                  return true;
      }
      else
         return true;      
    }
    
    
//----------------------- Add by zengshunbo 2009-03-12 TD:1214 -----------------------
   document.onkeydown   =   function() {
      var k = window.event.keyCode;
      if (k == 116)   
      {   
              window.event.keyCode    =   0;   
              window.event.returnValue=   false;   
      }   
   }
    </script>

    <link href="" rel="stylesheet" type="text/css" />
    <link href="" rel="stylesheet" type="text/css" />
    <link href="" rel="stylesheet" type="text/css" />
    <link href="" rel="stylesheet" type="text/css" />

    <%-- Issue U12: Add By Gordon 2015/05/25  --%>
    <link id="CSSCursor" rel="stylesheet" type="text/css" />

</head>
<body>
    <form id="form1" runat="server">    
        <AjaxControlToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server">
        </AjaxControlToolkit:ToolkitScriptManager>
            <table border="0" cellpadding="0" cellspacing="0" class="Page_Container">
                <tr>
                   <td colspan="2" class="Page_Head">
                        <WebStructure:PageHead ID="PageHead" runat="server" />
                    </td>
                </tr>               
                <tr>
                    <td class="Page_Left">
                        <WebStructure:MainMenu ID="MainMenu" runat="server" AppPath="../../" CurrMenuID="M140921" />
                    </td>
                    <%--<td class="Page_Right" style="width: 1143px">--%>
                    <td class="Page_Right">
                       <table class="Page_Contents">
                          <tr>
                            <td class="TabStrip" style="height: 2px"><WebStructure:TabStrip ID="TabStrip" CurrMenuID="M140824"  ParentMenuID="M140921" DMenuMode="CurrOnly" runat="server" /></td>
                          </tr>                                                  
                          <tr>
                            <td class="Contents" style="height: 16px">
                            <asp:UpdatePanel ID="UpdatePanel6" runat="server">
                            <ContentTemplate> 
                            <div style="width:97%;">
                                <fieldset style="clear:both; margin-bottom:10px;">
                                   <legend class="title1" >
                                      <asp:Label ID="lblLocalContractorStaffEntry" runat="server" Font-Bold="True" Font-Size="Small" CssClass="CodeSetupCaptionText">Local Contractor Staff Entry</asp:Label>
                                   </legend>
                                 <asp:HiddenField ID="hdStaffContractorLastUpdataTime" Value="" runat="server" />
                                   <asp:UpdatePanel ID="UpdatePanel7" runat="server">
                                   <ContentTemplate>
                                   <div id="SecandRow" style="width:100%;padding-left: 10px;padding-right: 10px; padding-top: 5px; padding-bottom: 1px;">

                                   <table width="100%">
                                    <tr>
                                        <td style="width: 180px">
                                            <asp:Label ID="lblContractorNo" runat="server" >Local Contractor No.</asp:Label>
                                        </td>
                                        <td>
                                            <%--<asp:TextBox ID="txtContractorNo" ReadOnly="true"  Width="380px" runat="server" MaxLength="30" TabIndex="7"></asp:TextBox>--%>
                                            <asp:Label ID="lblTxtContractorNo" runat="server" ></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 180px">
                                            <asp:Label ID="lblContractorCompany" runat="server">Local Contractor:</asp:Label><em>*</em>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlContractorCompany" Width="200px" OnSelectedIndexChanged="ddlContractorCompany_SelectedIndexChanged" runat="server">
                                             </asp:DropDownList>
                                             <asp:HiddenField ID="hfLocationID" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 180px">
                                            <asp:Label ID="lblContractorName1" runat="server">Local Contractor Staff Name 1:</asp:Label><em>*</em>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtContractorName1"  Width="380px" runat="server" MaxLength="50" TabIndex="7"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 180px">
                                            <asp:Label ID="lblContractorName2" runat="server" >Local Contractor Staff Name 2:</asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtContractorName2"  Width="380px" runat="server" MaxLength="50" TabIndex="7"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 180px">
                                            <asp:Label ID="lblContractorName3" runat="server" >Local Contractor Staff Name 3:</asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtContractorName3"  Width="380px" runat="server" MaxLength="50" TabIndex="7"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 180px">
                                            <asp:Label ID="lblContactNo" runat="server" >Contact No.:</asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtContactNo"  Width="380px" runat="server" MaxLength="50" TabIndex="7"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 180px">
                                            <asp:Label ID="lblObsolete" runat="server" >Obsolete:</asp:Label>
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="cbObsolete" runat="server" />
                                        </td>
                                    </tr>
                                    </table>                     
                                   </div>
                                  
                                   </ContentTemplate>
                                   </asp:UpdatePanel>
                                   <%--<div style="float:right;padding-top: 2px; padding-bottom: 5px;">
                                       <asp:Button ID="btnSaveTop" runat="server" OnClick="btnSave_Click" TabIndex="17" />
                                   </div>--%>
                                </fieldset>
                            </div>

                            </ContentTemplate>
                            </asp:UpdatePanel>
                            
                            </td>        
                          </tr>   
                                      
                          <tr>
                            <td class="Page_Foot" style="height: 53px"><WebStructure:PageFoot ID="PageFoot" runat="server" /></td>
                          </tr>
                       </table>
                    </td>
                </tr>
            </table>            
            <div id="divFlowMenu" runat="server">
                <img alt="" src="../../Images/up.gif" onclick="SwitchMenu(this);" />
                <!--add flow menu items begin-->
                <div>
                    <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click" TabIndex="40" /><%--OnClientClick="return CreatNew();"--%>
                </div>
                <div>                    
                    <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" TabIndex="42" />
                </div>
                <!--add flow menu items end-->
            </div>
            
            <AjaxControlToolkit:AlwaysVisibleControlExtender ID="AlwaysVisibleControlExtender_FlowMenu"
                runat="server" TargetControlID="divFlowMenu"   VerticalOffset="78" HorizontalOffset="1100">
            </AjaxControlToolkit:AlwaysVisibleControlExtender>
            
            <asp:HiddenField ID="hdnFlagDepature" runat="server" Value="0" />
            <asp:HiddenField ID="hdnFlagBookOff" runat="server" Value="" />
            <asp:HiddenField ID="hdnFlagNeedValit" runat="server" />
            <asp:HiddenField ID="hdnRequirePasswordStaffInfoID" runat="server" />
            <%--<input type="button" runat="server" id="btnCloseRecord" name="btnCloseRecord" onserverclick="btnCloseRecord_ServerClick" style="display:none;" />--%> <%--onclick="OpenAmendEventTimeForm();"--%>
           
        <br />
            <div style="DISPLAY: none">
            <asp:Button ID="btnDepatSave" runat="server"  />
            <asp:Button ID="btnOpenDepartPage" runat="server"/>
            </div>
            <div style="display:none;">
                <asp:HiddenField ID="HiddenField1" runat="server" />
    </div>
    </form>

</body>
</html>

<script type="text/javascript">
    LoadHoverEvent(document.all.divFlowMenu);                
    Sys.Application.add_load(SetFlowPos);
    window.onscroll=SetFlowPos;
    window.onresize=SetFlowPos;  
//    var focus=document.activeElement.name;
//    document.getElementById("HiddenField1").value=focus;   
</script>
